
addEventHandler("onClientResourceStart",getRootElement(),function()
    if getElementData(localPlayer,"player:uid") then return end
    if getElementData(localPlayer,"player:info_ban") then return end
    triggerServerEvent("cmta_bany:checkban", resourceRoot)
end)

loadstring(exports.dgs:dgsImportFunction())()
local sw,sh = guiGetScreenSize()
local px,py = sw/1366,sh/768
font = dgsCreateFont( ":cmta-pobieraniezasobow/OSB.ttf", 12*px )

addEvent("cmta_bany:ban", true)
addEventHandler("cmta_bany:ban", resourceRoot, function(result)
    dane_gracza = result
    setElementData(localPlayer,"player:info_ban",true)
    texture = dxCreateTexture( "bg.jpg" ,"argb", false, "clamp" )
    dgsCreateImage(0*px,0*py,1366*px,768*py,texture,false)
    addEventHandler("onClientRender",root,gui)
end)


function gui()
    showChat(false)
    showCursor(true)
    setPlayerHudComponentVisible ( "radar", false )  
end